home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / Extras / D51_NARexx / CDO.dopus5 next >
Text File  |  1995-08-18  |  2KB  |  45 lines

  1. /* CDO for Directory Opus 5
  2.    By Leo Davidson ("Nudel", Pot-Noodle/Gods'Gift Utilities)
  3.  
  4. $VER: CDO.dopus5 1.3 (18.8.95)
  5.  
  6.    Note: Please don't confuse this with the OCD script!
  7.    Note: "CDOpus" is an assembler version of this script, with extra features.
  8.  
  9.    When run from a Shell, will echo the path used by the SOURCE Lister.
  10.    Using an alias, this can be used as a command which CD's to the path
  11.    used by the SOURCE lister.
  12.  
  13.    To set up the command "CDO", add the following to your s:shell-startup:
  14. -------------------------------------------------------------------------------
  15. Alias CDO "CD *"*`rx DOpus5:ARexx/cdo.dopus5*`*""
  16. -------------------------------------------------------------------------------
  17.  
  18.    v1.01 -> v1.02 - Now makes sure there is a source lister. (Ahem)
  19.                     Now makes sure the DOPUS.1 port exists. (Double-Ahem)
  20.     v1.02 -> v1.3 - Now uses Show() instead of ShowList(). (Thanks Stoebi)
  21.                     Style Guide compliant version numbering and $VER string.
  22. */
  23.  
  24. options results
  25. options FAILAT 99
  26. signal on syntax;signal on ioerr
  27.  
  28. If Show("P","DOPUS.1") Then
  29.     address "DOPUS.1"        /* Assumes there's only one copy. */
  30. Else
  31.     Exit                /* If no DOPUS.1 port, exit */
  32.  
  33. lister query source stem source_handle.    /* Get handle of SOURCE lister(s). */
  34.  
  35. IF source_handle.count = 0 | source_handle.count = "SOURCE_HANDLE.COUNT" Then Do
  36.     dopus front
  37.     dopus request '"You must have a SOURCE lister!" OK'
  38.     EXIT
  39.     End
  40.  
  41. Lister Query source_handle.0 Path    /* Get its path. */
  42. Say Strip(RESULT,B,'"')            /* Echo result -> input of CD cmd. */
  43. Syntax:;IoErr:
  44. EXIT
  45.